/**
 * @Author: XXHH
 * @CreateTime: 2025-01-06
 */
class SingletonLazy{
    private static SingletonLazy instance = null;
    private SingletonLazy(){

    }
    public static SingletonLazy getInstance(){
        if (instance == null){
            instance = new SingletonLazy();
        }
        return instance;
    }

}

public class Demo35 {
    public static void main(String[] args) {
        SingletonLazy s1 = SingletonLazy.getInstance();
        SingletonLazy s2 = SingletonLazy.getInstance();
        //SingletonLazy s2 = new SingletonLazy();
        System.out.println(s1 == s2);
    }
}
